﻿// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'

Shader "Unlit/DemMap"
{
    Properties
    {
        _MainTex ("Texture", 2D) = "white" {}
		_DEM("DEM", 2D) = "white" {}
		_High("高度",Float) = 1
    }
    SubShader
    {
        Tags { "RenderType"="Opaque" }
        LOD 100

        Pass
        {
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag
        

			#include "UnityCG.cginc"
            struct appdata
            {
                float4 vertex : POSITION;
                float2 uv : TEXCOORD0;
            };

            struct v2f
            {
                float2 uv : TEXCOORD0;
                float4 vertex : SV_POSITION; 
				float4 c : POSITION1;
            };

            sampler2D _MainTex;
            float4 _MainTex_ST;
			sampler2D _DEM;
			float4 _DEM_ST;
			float _High;
            v2f vert (appdata v)
            {
                v2f o;
				o.uv = v.uv;
				fixed4 color = tex2D(_MainTex, v.uv);
				//o.c= fixed4(color.x, 0, 0, 0);
				//v.vertex.y = _High * color.x;
			    o.vertex = UnityObjectToClipPos(v.vertex);
                return o;
            }

            fixed4 frag (v2f i) : SV_Target
            {
				
			   fixed4 color = tex2D(_DEM, i.uv);
                fixed4 col = tex2D(_MainTex, i.uv);
				fixed4 c = fixed4(color.x, 0, 0, 0);
                return col;
            }
            ENDCG
        }
    }
}
